home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / rwvector.lha / RWVector2.1 / rw / DLUDecomp.h < prev    next >
C/C++ Source or Header  |  1989-08-18  |  1KB  |  52 lines

  1. #ifndef DLUDECOMP_H
  2. #define DLUDECOMP_H
  3. #pragma once 
  4.  
  5. /*
  6.  *    Declarations for double precision LU Decomposition
  7.  *
  8.  *    Copyright (C) 1988, 1989.
  9.  *
  10.  *    Dr. Thomas Keffer
  11.  *    Rogue Wave Associates
  12.  *    P.O. Box 85341
  13.  *    Seattle WA 98145-1341
  14.  *
  15.  *    Permission to use, copy, modify, and distribute this
  16.  *    software and its documentation for any purpose and
  17.  *    without fee is hereby granted, provided that the
  18.  *    above copyright notice appear in all copies and that
  19.  *    both that copyright notice and this permission notice
  20.  *    appear in supporting documentation.
  21.  *    
  22.  *    This software is provided "as is" without any
  23.  *    expressed or implied warranty.
  24.  *
  25.  *
  26.  *    @(#)DLUDecomp.h    2.1    8/18/89
  27.  */
  28.  
  29. #include "DGEMatrix.h"
  30.  
  31. class DLUDecomp : DGEMatrix {
  32.   fortran_int*        ipvt;    // Pivot indices
  33.   fortran_int        info;
  34.   fortran_int        order;
  35.  
  36.   DGEMatrix        copy()    {return DGEMatrix::copy();}
  37.   double*        data()    {return DGEMatrix::data();}
  38. protected:
  39.   void            assertDefined();
  40.   void            assertPivots();
  41. public:
  42.   DLUDecomp(const DGEMatrix&);
  43.   ~DLUDecomp()    {delete ipvt;}
  44.  
  45.   // Matrix algebra declarations:
  46.   friend double            determinant(const DLUDecomp&);
  47.   friend DGEMatrix        inverse(const DLUDecomp&);
  48.   friend DoubleVec        solve(const DLUDecomp&, const DoubleVec&);
  49. };
  50.  
  51. #endif DLUDECOMP_H
  52.